class RoomListWindowModule extends how.module.WindowModule
{
	public constructor(guiClass: any, dataClass: any) 
	{
        super(guiClass, dataClass);
	}

	public static response: any =
	{
		aaaaa: "2,103",	// 创建房卡房返回 房间id、房间密码
        bbbbb: "2,104", // 根据房间密码获得房间id
	}

	public static request: any = 
    {
		onRoomItemBtn: "onRoomItemBtn",     // 普通房
		onRoomItemBtn2: "onRoomItemBtn2",   // 房卡房
		onRCRoomCreate: "onRCRoomCreate",   // 创建房卡房
        onRCRoomJoin: "onRCRoomJoin",		// 加入房卡房
	}

	public updateData(roomCollection: eui.ArrayCollection):void
	{
		this.callUI("updateData", roomCollection);
	}

	    // 点击某个房间
    public onRoomItemBtn(roomData: any): void
    {
        AppData.getInstance().currentRoom = roomData;
		this.communicate(MainSceneModule.response.changeServer);
    }

	public onRoomItemBtn2(roomData: any):void
    {
        AppData.getInstance().currentRoom = roomData;
        this.callUI("showCardRoomPanel", true);
    }

	public onRCRoomCreate(roomData: any, roomConfig: any):void
    {
        this.hallSocket.send("2,3", {KindID:AppData.getInstance().currentRoom.kindID, round:5});
    }

    public onRCRoomJoin(password: string):void
    {
        this.hallSocket.send("2,4", {key : password});
    }

    public aaaaa(data:any):void
    {
        this.hallSocket.send("2,4", {key : data.key});
    }

    public bbbbb(data:any):void
    {
        var crData:CardRoomData  = new CardRoomData();
        AppData.getInstance().cardRoomData = crData;
        AppData.getInstance().cardRoomData.key = data.key;
        AppData.getInstance().cardRoomData.newSid = data.sid;
        AppData.getInstance().currentRoom.port = data.sid;
        this.communicate(MainSceneModule.response.changeServer);
    }
}

window["RoomListWindowModule"] || (window["RoomListWindowModule"] = RoomListWindowModule);